import json
def analysis(file,user_id):
    times = 0
    minutes = 0
    with open (file,"r") as userstudy:
        ori_file = json.load(userstudy)
        for user_json in ori_file:
            if user_json['user_id'] == user_id:
                times += 1
                minutes += user_json['minutes']
    return times,minutes


a ="./user_study.json"
print(analysis(a,199071))
